package com.my.consumer.controller;

import com.my.consumer.bean.User;
import com.my.consumer.feign.UserFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YangYunbo
 * @version 2021-07-08
 */
@RestController
@RequestMapping("/consumer")
@Slf4j
public class ConsumerController {

    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/get")
    public User get() {
        log.info("ConsumerController.get() start.........");
        User user = userFeignClient.get();
        log.info("ConsumerController.get() end.........");
        return user;
    }

}
